package com.gitee.xmhzzz.component.spring;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.autoconfigure.AutoConfigurationImportEvent;
import org.springframework.boot.autoconfigure.AutoConfigurationImportListener;

@Slf4j
public class LogAutoConfigurationImportListener implements AutoConfigurationImportListener {
    @Override
    public void onAutoConfigurationImportEvent(AutoConfigurationImportEvent event) {
        log.info(">>>> 项目排除自动装配的数量 {} ", event.getExclusions().size());
        if (log.isDebugEnabled()) {
            for (String str : event.getExclusions()) {
                log.debug(">>> [excluded by user] {} <<<", str);
            }
        }
        log.info(">>>> 项目自动装配的数量 {} ", event.getCandidateConfigurations().size());
        if (log.isDebugEnabled()) {
            for (String str : event.getCandidateConfigurations()) {
                log.debug(">>> [registered] {} <<<", str);
            }
        }
    }
}
